﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Agriculture.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class UpdatedModels : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Advice",
                table: "PrescriptionModel");

            migrationBuilder.DropColumn(
                name: "Department",
                table: "PrescriptionModel");

            migrationBuilder.DropColumn(
                name: "Description",
                table: "PrescriptionModel");

            migrationBuilder.DropColumn(
                name: "OrderId",
                table: "PrescriptionModel");

            migrationBuilder.DropColumn(
                name: "Amount",
                table: "MedicineOrderModel");

            migrationBuilder.DropColumn(
                name: "DeliveryTime",
                table: "MedicineOrderModel");

            migrationBuilder.DropColumn(
                name: "DiscountAmount",
                table: "MedicineOrderModel");

            migrationBuilder.DropColumn(
                name: "LogisticsCompany",
                table: "MedicineOrderModel");

            migrationBuilder.DropColumn(
                name: "LogisticsNo",
                table: "MedicineOrderModel");

            migrationBuilder.DropColumn(
                name: "OrderType",
                table: "MedicineOrderModel");

            migrationBuilder.DropColumn(
                name: "PayMethod",
                table: "MedicineOrderModel");

            migrationBuilder.DropColumn(
                name: "PayTime",
                table: "MedicineOrderModel");

            migrationBuilder.DropColumn(
                name: "ReceiveTime",
                table: "MedicineOrderModel");

            migrationBuilder.DropColumn(
                name: "Department",
                table: "ConsultationOrderModel");

            migrationBuilder.DropColumn(
                name: "DoctorName",
                table: "ConsultationOrderModel");

            migrationBuilder.RenameColumn(
                name: "PatientId",
                table: "PrescriptionModel",
                newName: "DoctorId");

            migrationBuilder.RenameColumn(
                name: "DoctorName",
                table: "PrescriptionModel",
                newName: "Treatment");

            migrationBuilder.RenameColumn(
                name: "illness",
                table: "PatientModel",
                newName: "Name");

            migrationBuilder.RenameColumn(
                name: "Sex",
                table: "PatientModel",
                newName: "KidneyFunction");

            migrationBuilder.RenameColumn(
                name: "RenalFunction",
                table: "PatientModel",
                newName: "IdCard");

            migrationBuilder.RenameColumn(
                name: "PatientName",
                table: "PatientModel",
                newName: "Gender");

            migrationBuilder.RenameColumn(
                name: "BirthPlan",
                table: "PatientModel",
                newName: "FertilityStatus");

            migrationBuilder.RenameColumn(
                name: "AllergicHistory",
                table: "PatientModel",
                newName: "DiseaseDescription");

            migrationBuilder.RenameColumn(
                name: "ReceiverName",
                table: "MedicineOrderModel",
                newName: "Receiver");

            migrationBuilder.RenameColumn(
                name: "PayAmount",
                table: "MedicineOrderModel",
                newName: "TotalAmount");

            migrationBuilder.RenameColumn(
                name: "Rating",
                table: "ConsultationOrderModel",
                newName: "PatientRating");

            migrationBuilder.RenameColumn(
                name: "Duration",
                table: "ConsultationOrderModel",
                newName: "ConsultationInfoId");

            migrationBuilder.RenameColumn(
                name: "Description",
                table: "ConsultationOrderModel",
                newName: "RefundReason");

            migrationBuilder.RenameColumn(
                name: "Comment",
                table: "ConsultationOrderModel",
                newName: "PatientComment");

            migrationBuilder.RenameColumn(
                name: "CancelReason",
                table: "ConsultationOrderModel",
                newName: "MedicalSituation");

            migrationBuilder.AddColumn<decimal>(
                name: "OrderAmount",
                table: "RegistrationOrderModel",
                type: "decimal(65,30)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<DateTime>(
                name: "SubmitTime",
                table: "RegistrationOrderModel",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AlterColumn<int>(
                name: "Status",
                table: "PrescriptionModel",
                type: "int",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "longtext")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<int>(
                name: "IsDeleted",
                table: "PrescriptionModel",
                type: "int",
                nullable: false,
                oldClrType: typeof(bool),
                oldType: "tinyint(1)");

            migrationBuilder.AlterColumn<int>(
                name: "IsDeleted",
                table: "PatientModel",
                type: "int",
                nullable: false,
                oldClrType: typeof(bool),
                oldType: "tinyint(1)");

            migrationBuilder.AddColumn<string>(
                name: "AllergyHistory",
                table: "PatientModel",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Disease",
                table: "PatientModel",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<int>(
                name: "UserId",
                table: "PatientModel",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AlterColumn<int>(
                name: "IsDeleted",
                table: "OrderMedicineModel",
                type: "int",
                nullable: false,
                oldClrType: typeof(bool),
                oldType: "tinyint(1)");

            migrationBuilder.AddColumn<int>(
                name: "MedicineId",
                table: "OrderMedicineModel",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "OrderNo",
                table: "OrderMedicineModel",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<int>(
                name: "IsDeleted",
                table: "MedicineOrderModel",
                type: "int",
                nullable: false,
                oldClrType: typeof(bool),
                oldType: "tinyint(1)");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "MedicineOrderModel",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldNullable: true);

            migrationBuilder.AddColumn<string>(
                name: "OrderNo",
                table: "LogisticsTrackingModel",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "TrackingNumber",
                table: "LogisticsTrackingModel",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<int>(
                name: "ConsultationType",
                table: "ConsultationOrderModel",
                type: "int",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "longtext")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<DateTime>(
                name: "AppointmentTime",
                table: "ConsultationOrderModel",
                type: "datetime(6)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "CallDuration",
                table: "ConsultationOrderModel",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "ConsultationFee",
                table: "ConsultationOrderModel",
                type: "decimal(65,30)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<int>(
                name: "ConsultationSource",
                table: "ConsultationOrderModel",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "ConsultationStatus",
                table: "ConsultationOrderModel",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<string>(
                name: "DiseaseDescription",
                table: "ConsultationOrderModel",
                type: "longtext",
                nullable: true)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<int>(
                name: "DoctorId",
                table: "ConsultationOrderModel",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<decimal>(
                name: "OrderAmount",
                table: "ConsultationOrderModel",
                type: "decimal(65,30)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<decimal>(
                name: "RefundAmount",
                table: "ConsultationOrderModel",
                type: "decimal(65,30)",
                nullable: true);

            migrationBuilder.AddColumn<DateTime>(
                name: "SubmitTime",
                table: "ConsultationOrderModel",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.CreateTable(
                name: "ConsultationInfoModel",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    ConsultationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    CallDuration = table.Column<int>(type: "int", nullable: true),
                    PatientRating = table.Column<int>(type: "int", nullable: true),
                    PatientComment = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    CreatePeople = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    UpdatePeople = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ConsultationInfoModel", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "DoctorModel",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Name = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Department = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Title = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Introduction = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Specialty = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ConsultationFee = table.Column<decimal>(type: "decimal(65,30)", nullable: false),
                    IsDeleted = table.Column<int>(type: "int", nullable: false),
                    CreatePeople = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    UpdatePeople = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DoctorModel", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "MedicineModel",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Name = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ImageUrl = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Price = table.Column<decimal>(type: "decimal(65,30)", nullable: false),
                    Description = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsDeleted = table.Column<int>(type: "int", nullable: false),
                    CreatePeople = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    UpdatePeople = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MedicineModel", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateIndex(
                name: "IX_RegistrationOrderModel_UserId",
                table: "RegistrationOrderModel",
                column: "UserId");

            migrationBuilder.CreateIndex(
                name: "IX_PrescriptionModel_DoctorId",
                table: "PrescriptionModel",
                column: "DoctorId");

            migrationBuilder.CreateIndex(
                name: "IX_OrderMedicineModel_MedicineId",
                table: "OrderMedicineModel",
                column: "MedicineId");

            migrationBuilder.CreateIndex(
                name: "IX_MedicineOrderModel_UserId",
                table: "MedicineOrderModel",
                column: "UserId");

            migrationBuilder.CreateIndex(
                name: "IX_ConsultationOrderModel_ConsultationInfoId",
                table: "ConsultationOrderModel",
                column: "ConsultationInfoId");

            migrationBuilder.CreateIndex(
                name: "IX_ConsultationOrderModel_DoctorId",
                table: "ConsultationOrderModel",
                column: "DoctorId");

            migrationBuilder.CreateIndex(
                name: "IX_ConsultationOrderModel_PatientId",
                table: "ConsultationOrderModel",
                column: "PatientId");

            migrationBuilder.AddForeignKey(
                name: "FK_ConsultationOrderModel_ConsultationInfoModel_ConsultationInf~",
                table: "ConsultationOrderModel",
                column: "ConsultationInfoId",
                principalTable: "ConsultationInfoModel",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_ConsultationOrderModel_DoctorModel_DoctorId",
                table: "ConsultationOrderModel",
                column: "DoctorId",
                principalTable: "DoctorModel",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_ConsultationOrderModel_PatientModel_PatientId",
                table: "ConsultationOrderModel",
                column: "PatientId",
                principalTable: "PatientModel",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_MedicineOrderModel_UserModel_UserId",
                table: "MedicineOrderModel",
                column: "UserId",
                principalTable: "UserModel",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_OrderMedicineModel_MedicineModel_MedicineId",
                table: "OrderMedicineModel",
                column: "MedicineId",
                principalTable: "MedicineModel",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_PrescriptionModel_DoctorModel_DoctorId",
                table: "PrescriptionModel",
                column: "DoctorId",
                principalTable: "DoctorModel",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);

            migrationBuilder.AddForeignKey(
                name: "FK_RegistrationOrderModel_UserModel_UserId",
                table: "RegistrationOrderModel",
                column: "UserId",
                principalTable: "UserModel",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_ConsultationOrderModel_ConsultationInfoModel_ConsultationInf~",
                table: "ConsultationOrderModel");

            migrationBuilder.DropForeignKey(
                name: "FK_ConsultationOrderModel_DoctorModel_DoctorId",
                table: "ConsultationOrderModel");

            migrationBuilder.DropForeignKey(
                name: "FK_ConsultationOrderModel_PatientModel_PatientId",
                table: "ConsultationOrderModel");

            migrationBuilder.DropForeignKey(
                name: "FK_MedicineOrderModel_UserModel_UserId",
                table: "MedicineOrderModel");

            migrationBuilder.DropForeignKey(
                name: "FK_OrderMedicineModel_MedicineModel_MedicineId",
                table: "OrderMedicineModel");

            migrationBuilder.DropForeignKey(
                name: "FK_PrescriptionModel_DoctorModel_DoctorId",
                table: "PrescriptionModel");

            migrationBuilder.DropForeignKey(
                name: "FK_RegistrationOrderModel_UserModel_UserId",
                table: "RegistrationOrderModel");

            migrationBuilder.DropTable(
                name: "ConsultationInfoModel");

            migrationBuilder.DropTable(
                name: "DoctorModel");

            migrationBuilder.DropTable(
                name: "MedicineModel");

            migrationBuilder.DropIndex(
                name: "IX_RegistrationOrderModel_UserId",
                table: "RegistrationOrderModel");

            migrationBuilder.DropIndex(
                name: "IX_PrescriptionModel_DoctorId",
                table: "PrescriptionModel");

            migrationBuilder.DropIndex(
                name: "IX_OrderMedicineModel_MedicineId",
                table: "OrderMedicineModel");

            migrationBuilder.DropIndex(
                name: "IX_MedicineOrderModel_UserId",
                table: "MedicineOrderModel");

            migrationBuilder.DropIndex(
                name: "IX_ConsultationOrderModel_ConsultationInfoId",
                table: "ConsultationOrderModel");

            migrationBuilder.DropIndex(
                name: "IX_ConsultationOrderModel_DoctorId",
                table: "ConsultationOrderModel");

            migrationBuilder.DropIndex(
                name: "IX_ConsultationOrderModel_PatientId",
                table: "ConsultationOrderModel");

            migrationBuilder.DropColumn(
                name: "OrderAmount",
                table: "RegistrationOrderModel");

            migrationBuilder.DropColumn(
                name: "SubmitTime",
                table: "RegistrationOrderModel");

            migrationBuilder.DropColumn(
                name: "AllergyHistory",
                table: "PatientModel");

            migrationBuilder.DropColumn(
                name: "Disease",
                table: "PatientModel");

            migrationBuilder.DropColumn(
                name: "UserId",
                table: "PatientModel");

            migrationBuilder.DropColumn(
                name: "MedicineId",
                table: "OrderMedicineModel");

            migrationBuilder.DropColumn(
                name: "OrderNo",
                table: "OrderMedicineModel");

            migrationBuilder.DropColumn(
                name: "OrderNo",
                table: "LogisticsTrackingModel");

            migrationBuilder.DropColumn(
                name: "TrackingNumber",
                table: "LogisticsTrackingModel");

            migrationBuilder.DropColumn(
                name: "AppointmentTime",
                table: "ConsultationOrderModel");

            migrationBuilder.DropColumn(
                name: "CallDuration",
                table: "ConsultationOrderModel");

            migrationBuilder.DropColumn(
                name: "ConsultationFee",
                table: "ConsultationOrderModel");

            migrationBuilder.DropColumn(
                name: "ConsultationSource",
                table: "ConsultationOrderModel");

            migrationBuilder.DropColumn(
                name: "ConsultationStatus",
                table: "ConsultationOrderModel");

            migrationBuilder.DropColumn(
                name: "DiseaseDescription",
                table: "ConsultationOrderModel");

            migrationBuilder.DropColumn(
                name: "DoctorId",
                table: "ConsultationOrderModel");

            migrationBuilder.DropColumn(
                name: "OrderAmount",
                table: "ConsultationOrderModel");

            migrationBuilder.DropColumn(
                name: "RefundAmount",
                table: "ConsultationOrderModel");

            migrationBuilder.DropColumn(
                name: "SubmitTime",
                table: "ConsultationOrderModel");

            migrationBuilder.RenameColumn(
                name: "Treatment",
                table: "PrescriptionModel",
                newName: "DoctorName");

            migrationBuilder.RenameColumn(
                name: "DoctorId",
                table: "PrescriptionModel",
                newName: "PatientId");

            migrationBuilder.RenameColumn(
                name: "Name",
                table: "PatientModel",
                newName: "illness");

            migrationBuilder.RenameColumn(
                name: "KidneyFunction",
                table: "PatientModel",
                newName: "Sex");

            migrationBuilder.RenameColumn(
                name: "IdCard",
                table: "PatientModel",
                newName: "RenalFunction");

            migrationBuilder.RenameColumn(
                name: "Gender",
                table: "PatientModel",
                newName: "PatientName");

            migrationBuilder.RenameColumn(
                name: "FertilityStatus",
                table: "PatientModel",
                newName: "BirthPlan");

            migrationBuilder.RenameColumn(
                name: "DiseaseDescription",
                table: "PatientModel",
                newName: "AllergicHistory");

            migrationBuilder.RenameColumn(
                name: "TotalAmount",
                table: "MedicineOrderModel",
                newName: "PayAmount");

            migrationBuilder.RenameColumn(
                name: "Receiver",
                table: "MedicineOrderModel",
                newName: "ReceiverName");

            migrationBuilder.RenameColumn(
                name: "RefundReason",
                table: "ConsultationOrderModel",
                newName: "Description");

            migrationBuilder.RenameColumn(
                name: "PatientRating",
                table: "ConsultationOrderModel",
                newName: "Rating");

            migrationBuilder.RenameColumn(
                name: "PatientComment",
                table: "ConsultationOrderModel",
                newName: "Comment");

            migrationBuilder.RenameColumn(
                name: "MedicalSituation",
                table: "ConsultationOrderModel",
                newName: "CancelReason");

            migrationBuilder.RenameColumn(
                name: "ConsultationInfoId",
                table: "ConsultationOrderModel",
                newName: "Duration");

            migrationBuilder.AlterColumn<string>(
                name: "Status",
                table: "PrescriptionModel",
                type: "longtext",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<bool>(
                name: "IsDeleted",
                table: "PrescriptionModel",
                type: "tinyint(1)",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AddColumn<string>(
                name: "Advice",
                table: "PrescriptionModel",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Department",
                table: "PrescriptionModel",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Description",
                table: "PrescriptionModel",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<int>(
                name: "OrderId",
                table: "PrescriptionModel",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AlterColumn<bool>(
                name: "IsDeleted",
                table: "PatientModel",
                type: "tinyint(1)",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AlterColumn<bool>(
                name: "IsDeleted",
                table: "OrderMedicineModel",
                type: "tinyint(1)",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AlterColumn<bool>(
                name: "IsDeleted",
                table: "MedicineOrderModel",
                type: "tinyint(1)",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "MedicineOrderModel",
                type: "datetime(6)",
                nullable: true,
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)");

            migrationBuilder.AddColumn<decimal>(
                name: "Amount",
                table: "MedicineOrderModel",
                type: "decimal(65,30)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<DateTime>(
                name: "DeliveryTime",
                table: "MedicineOrderModel",
                type: "datetime(6)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "DiscountAmount",
                table: "MedicineOrderModel",
                type: "decimal(65,30)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<string>(
                name: "LogisticsCompany",
                table: "MedicineOrderModel",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "LogisticsNo",
                table: "MedicineOrderModel",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "OrderType",
                table: "MedicineOrderModel",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "PayMethod",
                table: "MedicineOrderModel",
                type: "longtext",
                nullable: true)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<DateTime>(
                name: "PayTime",
                table: "MedicineOrderModel",
                type: "datetime(6)",
                nullable: true);

            migrationBuilder.AddColumn<DateTime>(
                name: "ReceiveTime",
                table: "MedicineOrderModel",
                type: "datetime(6)",
                nullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "ConsultationType",
                table: "ConsultationOrderModel",
                type: "longtext",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Department",
                table: "ConsultationOrderModel",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "DoctorName",
                table: "ConsultationOrderModel",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");
        }
    }
}
